using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableDailyCopyDao:DaoBase<TableDailyCopy>
    {
        public override void AddPrimaryIndex(TableDailyCopy model)
        {
            cachePrimary[model.Type.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableDailyCopy.txt";
        }

        protected override TableDailyCopy ParseRowData(string[] rowData)
        {
            TableDailyCopy data = new TableDailyCopy();
			data.Type = rowData [0];
			data.OpenDay = rowData [1];

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.Stamina = 0;
            }
            else
            {
                data.Stamina = int.Parse(rowData[2]);
            }

            if (string.IsNullOrEmpty(rowData[3]))
            {
                data.Count = 0;
            }
            else
            {
                data.Count = int.Parse(rowData[3]);
            }

            return data;
        }



    }

}
